-
Notifications
You must be signed in to change notification settings - Fork 21
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Implement AEIP2 update #580
Implement AEIP2 update #580
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We might also change a bit the explorer to display—based on the decimals—the number of tokens received.
210adb7
to
d28d553
Compare
Updated explorer UI to handle decimals, and display token symbol instead of address Also fixed bug of #560 |
uco_price_at_time = tx.validation_stamp.timestamp |> OracleChain.get_uco_price() | ||
uco_price_now = DateTime.utc_now() |> OracleChain.get_uco_price() | ||
|
||
tokens = |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If you want to reduce lines and avoid repetition you could use recursive function:
token_properties = []
|> get_token_addresses(ledger_inputs)
|> get_token_addresses(transaction_movements)
|> get_token_addresses(token_transfers)
|> Enum.uniq()
|> get_token_properties()
# ...
defp get_token_addresses(acc, [ %TransactionMovement{ type: {:token, token_address, _}} | rest ]) do
get_token_addresses([ token_address | acc ], rest)
end
defp get_token_addresses(acc, [ %TransactionInput{ type: {:token, token_address, _}} | rest]) do
get_token_addresses([ token_address | acc ], rest)
end
defp get_token_addresses(acc, [ %TokenTransfer{ token_address: token_address } | rest ]) do
get_token_addresses([ token_address | acc ], rest)
end
defp get_token_addresses(acc, _) do
get_token_addresses(acc, rest)
end
defp get_token_addresses(acc, []) do, do: acc
d28d553
to
8e298cc
Compare
Description
Implementation of the new version of AEIP2 (archethic-foundation/aeip@71d6e4f)
Fixes archethic-foundation/aeip#4 / archethic-foundation/aeip#9
Type of change
How Has This Been Tested?
Update test files
Creation of multiple NFT with or without collection, id, properties ...
Checklist: